//
//  NeoNuiManager.h
//  GLUZSwift
//
//  Created by xyanl on 2025/4/3.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, NeoNuiLanguageType) {
    // 中文
    NeoNuiLanguageTypeZh,
    // 中文音频文件
    NeoNuiLanguageTypeFileZh,
    // 俄语
    NeoNuiLanguageTypeRu,
    // 俄语音频文件
    NeoNuiLanguageTypeFileRu
};

/// 小牛运行状态
typedef NS_ENUM(NSUInteger, NeoNuiState) {
    /// 运行中
    NeoNuiStateRunning,
    /// 暂停
    NeoNuiStatePause,
    /// 停止
    NeoNuiStateStop,
};

@protocol NeoNuiDelegate <NSObject>

/// 实时转写结果
/// - Parameters:
///   - text: 实时转写结果
///   - languageType: 语言类型
///   - isEnd: YES: 识别一句话结束, NO:转写中间结果
- (void)neoNuiRealtimeTranslation:(NSString *)text languageType:(NeoNuiLanguageType)languageType isEnd:(BOOL)isEnd;


- (void)neoNuiRealtimeTranslationEnd:(BOOL)isFinish;

/// 音频能量事件。
/// - Parameter rms: 语音能量值，范围为-160至0
- (void)neoNuiRmsChanged:(float)rms;

@end

@interface NeoNuiManager : NSObject

@property (nonatomic, weak) id<NeoNuiDelegate> delegate;

+ (NeoNuiManager *)shared;

/// 初始话SDK
/// - Parameter languageType: 设置转写语言
- (void)initNeoNui:(NeoNuiLanguageType)languageType delegate:(id<NeoNuiDelegate>)delegate;

/// 切换语言
//- (void)switchLanguage:(NeoNuiLanguageType)languageType;

/// 开始
- (void)startNeoNui;
/// 暂停
- (void)pauseNeoNui;
/// 停止
- (void)stopNeoNui;

/// 开始音频采集
- (void)startAudioDataObserver;
/// 停止音频采集
- (void)stopAudioDataObserver;

@end

NS_ASSUME_NONNULL_END
